package com.t174.car.controller;

import com.t174.car.dao.GuestsCarDao;
import com.t174.car.entity.GuestsCar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@Scope("prototype")
@RequestMapping("/repair")
public class GuestsCarController {
    @Autowired
    GuestsCarDao guestsCarDao;
    @RequestMapping("/getCar")
    @ResponseBody
    public List<GuestsCar> getCarByGid(int id){
        return guestsCarDao.getGuestsCar(id);
    }
    @RequestMapping("/addCar")
    @ResponseBody
    public Integer addCar(GuestsCar guestsCar){
        return guestsCarDao.addCar(guestsCar);
    }
    @RequestMapping("/delCar")
    @ResponseBody
    public Integer delCar(Integer id){
        return guestsCarDao.delCar(id);
    }

    @RequestMapping("/upCar")
    @ResponseBody
    public Integer upCar(GuestsCar guestsCar){
        return guestsCarDao.upCar(guestsCar);
    }
}
